<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <title>属性选择器</title>
    <script type="text/javascript" src="js/jquery-1.8.2.js"></script>
    <script type="text/javascript">
        //整个页面加载完之后再执行
        $(function(){
            //1)查找所有含有id属性的div元素个数
            var div$01=$('div[id]');
            console.log('包含某个属性的个数:'+div$01.length)
            console.group('带有属性的标签：');
            div$01.each(function(){
                console.log(this.innerHTML);
            });
            console.groupEnd();
        })
    </script>
</head>
<body>
<p>Hello!</p>
</div>
<div id="test2">div02</div>
<div id="test3">div03</div>
</body>
</html>